#include <iostream>
#include <vector>
using namespace std;

int lowbit(int x)
{
	return x & (-x);
}

int sum(vector<int> &starts, int x)
{
	int ans = 0;
	while (x > 0) {
		ans += starts[x];
		x -= lowbit(x);
	}
	return ans;
}

void add(vector<int> &starts, int x, int v)
{
	int n = starts.size();
	while (x <= n) {
		starts[x] += v;
		x += lowbit(x);
	}
}

int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	cin >> n;

	vector<int> starts(32005, 0);
	vector<int> level(n + 2, 0);

	for (int i = 0, x, y; i < n; i++) {
		cin >> x >> y;
		x++;
		int cnt = sum(starts, x);
		level[cnt]++;
		add(starts, x, 1);
	}

	for (int i = 0; i < n; i++) {
		cout << level[i] << '\n';
	}

	return 0;
}
